package com.redis.controller;

import com.redis.entity.Concert;
import com.redis.service.TicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Li
 * @Date: 2024/12/18 15:38
 * @Description: 实现查询演唱会门票和购票功能
 */

@RestController
public class TicketController {
    @Autowired
    private TicketService ticketService;
    
    // 购票功能
    @GetMapping("purchase")
    public String purchase(Integer uid, Integer cid) {
        return ticketService.purchase(uid, cid);
    }

    @GetMapping("getAllConcert")
    public List<Concert> getAllConcert() {
        return ticketService.getAllConcert();
    }

}
